home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 128 28 / q28.d81 / t.name the song < prev    next >
Text File  |  2022-08-28  |  5KB  |  102 lines

  1.  
  2.  
  3.                       N A M E   T H E   S O N G
  4.  
  5.           Program and Text by Rick Kephart rmk@netaxs.com
  6.  
  7.  
  8. FENDER'S PREMUMBLE: You may not be familiar with Rick Kephart because he
  9. has only written for LOADSTAR 64 until now.  I didn't even know he had a C-
  10. 128.  But now that he's decided to tackle the 80-column 128 mode you're in
  11. for a treat because, like Tina Turner, he nevah, evah does anything nice
  12. and easy; he goes whole hog in everything he does.  Where others may have
  13. had 40 or 50 songs in a name-that-tune program, Rick has 128.  In his
  14. popular language quiz programs on LS 64 he'd include hundreds of foreign
  15. words and their translations, then include a 60-block scholarly treatise on
  16. the language.  It's a style I like a lot and I think you will, too.  Here's
  17. Rick to tell you all about his first 128 program for LOADSTAR...
  18.  
  19.  
  20.      This is a song-guessing game.
  21.  
  22.      For each song, you are given a clue at the bottom of the screen.  The
  23. clue may be a portion of lyrics, or an alternate title, or some facts about
  24. the song, or some other means of identifying the melody.
  25.  
  26.     You bet on how many notes you think it will take you to identify the
  27. tune.  The fewer the notes you think it will take, the bigger the bet.  The
  28. bet ranges from 1 point for the entire song, to 99 points for identifying
  29. the song in one note.
  30.  
  31.     Then you enter your guess in the guess box in the center of the screen.
  32. The size of the box allows the exact length of the title of the song, to
  33. the right edge of the box.  This is a clear tipoff to the title; you can
  34. only enter enough letters for the title and you must use all the spaces the
  35. input routine will allow.  For instance, for the WABASH CANNON BALL, you
  36. can tell it's not WABASH CANNONBALL since there will be one space left
  37. over.
  38.  
  39.     If you can correctly identify the song, the number of points you bet is
  40. added to your score.  Otherwise, that number of points is deducted from
  41. your score.  You start out with 100 points to bet with.  If your score
  42. drops to nothing, then you lose.  If your score reaches 500 or more, then
  43. you win!
  44.  
  45.  
  46.  ADDING SONGS OF YOUR OWN
  47.  ------------------------
  48.  
  49.     There are 128 different songs in the program.  You can easily add more
  50. songs to the game!  First, use RUN/STOP-RESTORE to exit to BASIC.  Add your
  51. new songs at the end of the program, but above line 20000.  The last line
  52. in the program must be RETURN.
  53.  
  54.     The songs are simply normal PLAY strings in BASIC (see your System
  55. Guide for details on how to write PLAY strings).  They are stored in array
  56. variables M$().  The next song to be added would be M$(129).  The titles of
  57. the songs are stored in the variables T$(1) to T$(128), so the next title
  58. would be T$(129).  The clues are stored in variables C$().  The default
  59. tempo is TEMPO10.  To play the tune at any other tempo, add a fourth
  60. variable, T().
  61.  
  62.     After adding your song, you must change the variable NS in the first
  63. line.  It is set at NS=128.  Change this variable to the new number of
  64. songs in the program, i.e. if you add one song, it will be NS=129.  Add
  65. another song, and you must change it to NS=130.  This variable must contain
  66. the exact number of songs in the program or the game will malfunction
  67. eventually.
  68.  
  69.      Then you can SAVE your new version of the game, with your tune(s)
  70. added.  With the disk in the drive you can simply enter GOTO 10000 to
  71. scratch and save the new version.
  72.  
  73.      The maximum number of songs there can be in this game is 255.
  74.  
  75.  
  76.  TECHNICAL NOTE
  77.  --------------
  78.  
  79.  Line 10002
  80.  
  81. 10002 RL=LEN(R$):IFRL=0THENFORRL=1TONS:R$=R$+CHR$(RL):NEXT:GOTO10002:ELSE:R
  82. N=RND(0)*RL+1:R=ASC(MID$(R$,RN,1)):R$=LEFT$(R$,RN-1)+RIGHT$(R$,RL-
  83. RN+1):RETURN
  84.  
  85. is what I believe to be the smallest, simplest, and fastest non-repeating
  86. BASIC random selector possible.  It will choose a random element from a
  87. maximum of 255 choices, without repeating until all elements have been
  88. chosen once; then it will restart selecting them in another random pattern.
  89. GOSUB'd with variable NS containing the number of elements, it will return
  90. a random value in variable R.  It works by generating a string of bytes
  91. [R$] from one to the maximum value.  It then selects an individual
  92. character from within that string, and then closes up the string and makes
  93. it one character smaller.  A similar system could easily be used in C-64
  94. BASIC.  It would be possible to slightly increase the speed by adding
  95. another variable to store the full R$, and then restoring it to R$ when R$
  96. is exhausted.  But this would take an additional line and an additional
  97. variable, and the pause for re-building R$ is imperceptible during the
  98. game.
  99.  
  100.  RK
  101.  
  102.